<?php

$this->pageTitle = sprintf(
	'Publication - %s',
	$this->title
);

$this->navigationMenu()->addDefaultItems();

foreach ($this->data as $b => $c) {
	switch ($c) {
		case 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type':
			$type = $b;
			break;
		case 'http://swrc.ontoware.org/ontology#month':
			$month = $b;
			break;
		case 'http://purl.org/dc/elements/1.1/title':
			$title = $b;
			break;
		case 'http://purl.org/dc/terms/partOf':
			$partOf = $b;
			break;
		case 'http://purl.org/dc/elements/1.1/creator':
			$makers[] = $b;
			break;
		case 'http://xmlns.com/foaf/0.1/homepage':
			$homepage = $b;
			break;
		case 'http://purl.org/dc/terms/issued':
			$year = $b;
			break;
		case 'http://dbpedia.org/ontology/Place':
			$place = $b;
			break;
	}
}
if($place != ''){
	$this->actionBar()->addAction('Information about location', sprintf($this->baseUrl('/page/publication/dbpedia/%s/'), $this->title));
	$this->actionBar()->addAction('Map plot of location', sprintf($this->baseUrl('/page/publication/map/%s/'), $this->title));
}

echo '<h1>'.$title.'</h1>';
echo '<h2>Date of publication: ';
echo ($month != '') ? $month.', ': '';
echo $year.'</h2>';

if($partOf != '')
	echo '<p>This publication was part of the following event: <em>'.$partOf.'</em>.';

if($homepage != '')
	echo '<p>More information about this publication: <a href="'.$homepage.'">'.$homepage.'</a>.</p>';

echo '<div class="top rounded-top color-widget-dark"></div>';
echo '<div class="content color-widget-dark">';
echo '<h3>Creators of this publication</h3>';
foreach($makers as $maker){
	echo '<a href="'.$maker.'">'.$maker.'</a><br/>';
}
echo '</div>';
echo '<div class="bottom rounded-bottom color-widget-dark"></div>';
?>